<template>
	<view class="">
		<view class="text-center padding">
			司机服务满意度评价
		</view>
		<form @submit="subm">
		  <view class="padding-bottom bg-white">
			<view class="cu-form-group solid-top">
				<view class="title text-gray">1、服务态度</view>
			</view>
			<radio-group name="attitude" class="flex text-center padding-xs">
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="0" checked="true" />优秀</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="1" />良好</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="2" />一般</label>
			</radio-group>
			<view class="cu-form-group solid-top">
				<view class="title text-gray">2、路况熟悉</view>
			</view>
			<radio-group name="roadknow" class="flex text-center padding-xs">
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="0" checked="true" />优秀</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="1" />良好</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="2" />一般</label>
			</radio-group>
			<view class="cu-form-group solid-top">
				<view class="title text-gray">3、车辆卫生</view>
			</view>
			<radio-group name="health" class="flex text-center padding-xs">
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="0" checked="true" />优秀</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="1" />良好</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="2" />一般</label>
			</radio-group>
			<view class="cu-form-group solid-top">
				<view class="title text-gray">4、司机形象</view>
			</view>
			<radio-group name="image" class="flex text-center padding-xs">
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="0" checked="true" />优秀</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="1" />良好</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="2" />一般</label>
			</radio-group>
			<view class="cu-form-group solid-top">
				<view class="title text-gray">5、司机是否在车内吸烟</view>
			</view>
			<radio-group name="smoke" class="flex text-center padding-xs">
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="1" />是</label>
				<label class="radio flex-sub"><radio class="margin-right-xs" :value="0" checked="true" />否</label>
			</radio-group>
			
			<view class="cu-form-group solid-top">
				<view class="title text-gray">6、司机师傅吃饭自理</view>
				<picker @change="eatChange" name="eat" :value="eat" :range="list">
					<view class="picker">
						{{eat}} 顿
					</view>
				</picker>
			</view>
			<view class="cu-form-group">
				<view class="title text-gray">6、司机师傅吃饭自理</view>
				<picker @change="resideChange" name="reside" :value="reside" :range="list">
					<view class="picker">
						{{reside}} 晚
					</view>
				</picker>
			</view>
			<view class="cu-form-group">
				<view class="title text-gray">评语</view>
			</view>
			<view class="padding-xs">
				<input hidden name="orderId" :value="orderId" />
				<textarea class="solid padding-sm" name="comment" placeholder="亲，您的评价会帮助我们更好的提升自己哦。" style="margin: 0 auto;height: 120px;" />
			</view>
			
			<view class="margin-xl">
				<button type="primary" form-type="submit">提 交</button>
			</view>
		  </view>
		</form>
	</view>
</template>

<script>
	import {isPhone} from '../../utils/util.js'
	export default {
		data() {
			return {
				list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
				eat: 0,
				reside: 0,
				orderId: ''
			}
		},
		onLoad(options) {
			this.orderId = options.id
		},
		methods: {
			subm(e){
				let data = e.detail.value;
				uni.showLoading({
					title: '提交中...',
					mask: true
				})
				this.baseRequest('app/bus/custoderevaluate/save', 'POST', data, function (res, info) {
					uni.hideLoading();
					setTimeout(() => {
						uni.showToast({
						  title: '提交成功'
						});
						setTimeout(() => {
						  uni.hideToast();
						  uni.navigateBack({
						  	
						  })
						}, 1000)
					}, 0);
				});
			},
			eatChange(e){
				this.eat = e.target.value
			},
			resideChange(e){
				this.reside = e.target.value
			}
		}
	}
</script>
